import java.util.StringJoiner;

/**
 * @author <a href="mailto:mojo_jj@163.com">Mojo</a>
 */
public class MyDate implements Comparable<MyDate> {
    private Integer year;
    private Integer month;
    private Integer day;

    public Integer getYear() {
        return year;
    }

    public void setYear(Integer year) {
        this.year = year;
    }

    public Integer getMonth() {
        return month;
    }

    public void setMonth(Integer month) {
        this.month = month;
    }

    public Integer getDay() {
        return day;
    }

    public void setDay(Integer day) {
        this.day = day;
    }

    public MyDate(Integer year, Integer month, Integer day) {
        this.year = year;
        this.month = month;
        this.day = day;
    }

    @Override
    public String toString() {
        return new StringJoiner(", ", MyDate.class.getSimpleName() + "[", "]")
                .add("year=" + year)
                .add("month=" + month)
                .add("day=" + day)
                .toString();
    }

    @Override
    public int compareTo(MyDate o) {

        return this.year.compareTo(o.getYear());
    }
}
